<?php
/**
 * Display Contact List for Ajax Calls
 * 
 */
// Contact has an array
use Doctrine\DBAL\Connection;
use Hive\Mission;
use Fox\Dao\SqlFragment;
use Fox\Behaviors;
$xview = Xview::instance();

/* @var $mission Hive\Mission */
$mission = $xview->component("missions", "object");
// Load All Others Contacts
$filters[] = new SqlFragment('role NOT IN (?)',array(array(Mission\Partner::ROLE_CANDIDATE,
					Mission\Partner::ROLE_RESPONSIBLE,Mission\Partner::ROLE_ACCOUNT)),array(Connection::PARAM_STR_ARRAY));
$data['gContacts'] = $mission->contactsInfos($filters);

$blContacts = $xview->component('missions', 'contacts');
/*
$blContacts->item('gContacts')->footer()->add(new Fox\Html\Button(array("add","addContact")))
				->behaviors(Behaviors::action(
				Generator::url("missions","contacts","add",
				array("missionid" => $mission->getId())),true
));
*/
$blContacts->initialize($data);
echo $blContacts->item('gContacts')->display();